/**
 * 类功能描述：
 * 
 * 存放PDM物料与ERP物料模板之间的对应关系的POJO类
 *     
 * <br><br>
 * <b>Revision History</b>
 * <br><b>Rev:</b> 1.0 – 2012-07-12，魏文杰
 * <br><b>Comment:</b> Initial release.
 **/

package ext.generic.erp.bean;

public class ERPPartTemplateBean {
	private String rowIndex = "" ;
	
	private String pdmPartCode = ""	 ;
	
	private String pdmPartENameOrSource = "" ;

	private String erpPartCategory = "" ;
	
	private String erpPartTemplate = "" ;

	public String getRowIndex() {
		return rowIndex;
	}

	public void setRowIndex(String rowIndex) {
		this.rowIndex = rowIndex;
	}

	public String getPdmPartCode() {
		return pdmPartCode;
	}

	public void setPdmPartCode(String pdmPartCode) {
		this.pdmPartCode = pdmPartCode;
	}

	public String getPdmPartENameOrSource() {
		return pdmPartENameOrSource;
	}

	public void setPdmPartENameOrSource(String pdmPartENameOrSource) {
		this.pdmPartENameOrSource = pdmPartENameOrSource;
	}

	public String getErpPartCategory() {
		return erpPartCategory;
	}

	public void setErpPartCategory(String erpPartCategory) {
		this.erpPartCategory = erpPartCategory;
	}

	public String getErpPartTemplate() {
		return erpPartTemplate;
	}

	public void setErpPartTemplate(String erpPartTemplate) {
		this.erpPartTemplate = erpPartTemplate;
	}
	
	@Override
	public boolean equals(Object obj) {
		boolean isEqual = false ;
		
		if( obj != null && obj instanceof ERPPartTemplateBean ){
			ERPPartTemplateBean erpPartTemplateBean = ( ERPPartTemplateBean) obj ;
			
			String myPDMPartCode = erpPartTemplateBean.getPdmPartCode() ;
			String myPDMPartENameOrSource = erpPartTemplateBean.getPdmPartENameOrSource() ;
			
			if( myPDMPartCode == null ){
				myPDMPartCode = ""	 ;
			}
			
			if( myPDMPartENameOrSource == null ){
				myPDMPartENameOrSource = "" ;
			}
			
			if( myPDMPartCode.equals( this.pdmPartCode ) && myPDMPartENameOrSource.equals( this.getPdmPartENameOrSource() ) ){
				isEqual = true ;
			}
		}
		
		return isEqual ;
	}
	
	@Override
	public String toString() {
		StringBuffer strBuffer = new StringBuffer("    ") ;
		
		strBuffer.append(this.rowIndex) ;
		strBuffer.append(" : ") ;
		
		strBuffer.append("pdmPartCode : ") ;
		strBuffer.append(this.pdmPartCode) ;
		strBuffer.append(" ; ") ;
		
		strBuffer.append("pdmPartENameOrSource : ") ;
		strBuffer.append(this.pdmPartENameOrSource) ;
		strBuffer.append(" ; ") ;
		
		strBuffer.append("erpPartCategory : ") ;
		strBuffer.append(this.erpPartCategory) ;
		strBuffer.append(" ; ") ;
		
		strBuffer.append("erpPartTemplate : ") ;
		strBuffer.append(this.erpPartTemplate) ;
		strBuffer.append("\n") ;
		
		return strBuffer.toString() ;
	}
}
